package com.wbcs.system.permission.permissiontype;

import com.wbcs.util.Consts;

public class DisabledPermissionType extends AbsPermissionType
{
    public DisabledPermissionType()
    {
        super();
        this.typeName=Consts.PERMISSION_TYPE_DISABLED;
        this.defaultvalue="false";
        registerPermissionValue("true");
        registerPermissionValue("false");
    }
    
    @Override
	public boolean isConsistentWithParentPermission(String permissionvalue,boolean parentPermission)
    {
        if(permissionvalue==null) return false;
        if(!this.getLstPermissionValues().contains(permissionvalue.toLowerCase().trim())) return false;
        if(permissionvalue.equals("true"))
        {
            if(parentPermission)
            {
                return true;
            }else
            {
                return false;
            }
        }else
        {
            if(parentPermission)
            {
                return false;
            }else
            {
                return true;
            }
        }
    }
}

